using System;
using System.Collections;
using OracleInternal.Common;
using OracleInternal.ServiceObjects;

namespace Oracle.ManagedDataAccess.Client
{
	public class OracleNotificationRequest
	{
		internal static Hashtable s_idTable = Hashtable.Synchronized(new Hashtable());

		internal static bool s_bDefIsNotifiedOnce = true;

		internal static int s_DefRegTimeout = 50000;

		internal static bool s_bDefIsPersistent = false;

		internal static string s_ChangedNotificationName = "OracleDatabaseChangedNotificationService";

		internal long m_id;

		internal string m_service;

		internal bool m_bIsNotifiedOnce;

		internal bool m_bIsPersistent;

		internal long m_timeout;

		internal long Id => m_id;

		public bool IsNotifiedOnce
		{
			get
			{
				return m_bIsNotifiedOnce;
			}
			set
			{
				m_bIsNotifiedOnce = value;
			}
		}

		public bool IsPersistent
		{
			get
			{
				return m_bIsPersistent;
			}
			set
			{
				m_bIsPersistent = value;
			}
		}

		public long Timeout
		{
			get
			{
				return m_timeout;
			}
			set
			{
				if (value < 0 || value > uint.MaxValue)
				{
					throw new ArgumentOutOfRangeException("Timeout");
				}
				m_timeout = value;
			}
		}

		internal OracleNotificationRequest(string service, OracleDependencyImpl orclDependencyImpl)
		{
			if (ProviderConfig.m_bTraceLevelPrivate)
			{
				Trace.Write(OracleTraceLevel.Private, OracleTraceTag.Entry, OracleTraceClassName.OracleNotificationRequest, OracleTraceFuncName.ctor);
			}
			try
			{
				m_service = service;
				m_id = orclDependencyImpl.m_clientRegistrationId;
				m_bIsNotifiedOnce = orclDependencyImpl.m_bIsNotifiedOnce;
				m_bIsPersistent = orclDependencyImpl.m_bIsPersistent;
				m_timeout = orclDependencyImpl.m_timeout;
			}
			finally
			{
				if (ProviderConfig.m_bTraceLevelPrivate)
				{
					Trace.Write(OracleTraceLevel.Private, OracleTraceTag.Exit, OracleTraceClassName.OracleNotificationRequest, OracleTraceFuncName.ctor);
				}
			}
		}
	}
}
